package com.liutaw.nanjingair.dagger.module;

import android.content.Context;


import com.liutaw.nanjingair.UIThread;
import com.liutaw.nanjingair.views.activities.AndroidApplication;
import com.szjlxh.data.executor.JobExecutor;
import com.szjlxh.data.repository.BaseWeatherRepository;
import com.szjlxh.domain.executor.PostExecutionThread;
import com.szjlxh.domain.executor.ThreadExecutor;
import com.szjlxh.domain.repository.IBaseWeatherRespository;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

/**
 * Created by liutao on 16/3/16.
 */
@Module
public class ApplicationModule {
    private final AndroidApplication application;

    public ApplicationModule(AndroidApplication application) {
        this.application = application;
    }

    @Provides @Singleton
    Context provideApplicationContext() {
        return this.application;
    }

    @Provides @Singleton
    IBaseWeatherRespository provideBaseWeatherRespository(BaseWeatherRepository baseWeatherRepository) {
        return baseWeatherRepository;
    }

    @Provides @Singleton
    ThreadExecutor provideThreadExecutor(JobExecutor jobExecutor) {
        return jobExecutor;
    }

    @Provides @Singleton
    PostExecutionThread providePostExecutionThread(UIThread uiThread) {
        return uiThread;
    }

//    @Provides @Singleton
//    Navigator provideNavigator(Navigator navigator) {
//        return navigator;
//    }
}
